<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="${ctx}/styles/gsjcss/common.css">
<title>国省自检--${fns:getConfig('productName')}</title>
<script type="text/javascript">
	function btnClick(){
		var url = '${ctx}/technicalTrain/search.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}';
		var data = {};
			//将条件提取出来  存入data中  然后ajax请求   得到数据
		data['retrieval'] = getJson('condition');
		loadData(url,data);
	}
	//ajax执行成功之后的回调方法
	function loadDataToTable(data){
		var attData = data['att'];
		var trains = data['trains'];
		loadAttachment(attData);
			var content = '<table  style="width:98%;text-align:center;margin-top:5px;" border="1">'+
				'<thead>'+
			'<tr>'+
			'<th rowspan="2">序号</th>'+
			'<th colspan="3">技术培训、技术交流、技术竞赛</th>'+
			'</tr>'+
			'<tr>'+
			'<th>时间</th>'+
			'<th>名称</th>'+
			'<th>参加人数</th>'+
			'</tr>'+
			'<thead><tbody>';
			for(var i =0; i<trains.length; i++){
				content += '<tr>'+
						'<td>'+(i+1)+'</td>'+
						'<td>'+trains[i].trainStartTime+'～'+trains[i].trainEndTime+'</td>'+
						'<td>'+trains[i].trainName+'</td>'+
						'<td>'+trains[i].personCount+'人</td>'+
					'</tr>';
			}
			content += '<tr>'+
							'<td></td>'+
							'<td></td>'+
							'<td style="text-align:right;padding-right:20px">小计：</td>'+
							'<td style="text-align:center;" class="sumTd">'+data['count']+'（次数）</td>'+
						'</tr>'+
						'<tr>'+
							'<td></td>'+
							'<td></td>'+
							'<td style="text-align:right;padding-right:20px">人员合计:</td>'+
							'<td style="text-align:center;" class="perTd">'+data['totalPerson']+'人</td>'+
						'</tr>'+
		'</tbody>'+
	'</table>'
			$('#checkResult').append(content);
	}
</script>
</head>
<body>
	<div id="x_top"></div>
	<tags:message content="${msg}" />
	<c:if test="${not empty checkTable.id}">
		<div style="text-align:center">
			<a href="javascript:void(0);" class="btn btn-primary" onclick="downWord('${ctx}/technicalTrain/downWord.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}');" id= "btnDown" role="button" ><div id="x_v"></div></a>
		</div>
	</c:if>
	<form id="checkForm" class="form-horizontal"  method="POST"  name="checkForm" action="${ctx}/technicalTrain/save.do?left=${fns:encodeParam(left)}&parentId=${fns:encodeParam(parentId)}&projectId=${fns:encodeParam(projectId)}&menuId=${fns:encodeParam(menuId)}&leftChild=${fns:encodeParam(leftChild)}">
		<input type="hidden" name="token" value="${token}">
		<div id="show">
			<div id="showTable" class="showTable">
				<jsp:include page="/WEB-INF/views/check/common.jsp"/> 
				<div class="model">
					<div>
						<legend>三、检查条件及设置</legend>
						<div class="content-title" id="condition">
							<div style="float:left;margin-right:10px;">
								<span>每开展一次技术培训得分<font style="color:red;">*</font>：</span>
								<input type='text' name = "yearPart" id="yearPart" value="0.5"  class="required conInput"/>
								<span>最多得分<font style="color:red;">*</font>：</span>
								<input type='text' name = "yearFull" id="yearFull" value="5"  class="required conInput"/>
							</div>
						</div>
					</div>
				</div>
				<div class="model">
					<div>
						<legend>四、检索结果</legend>
						<div class="content-title">
							<div class="tabbox">
								<div class="tab">
									<c:forEach items="${childMenuList}" var="menu"  varStatus="idxStatus">
										<c:if test="${idxStatus.index >= 1}">
											<a href="javascript:;" ${idxStatus.index==1?"class='on'":""}>${menu.name}</a>
										</c:if>
									</c:forEach>
							    </div>
							    <div class="content">
							    	<ul>
							    		<c:forEach items="${childMenuList}" var="menu"  varStatus="idxStatus">
							    			<c:if test="${idxStatus.index >= 1}">
								    			<li>
								    				<table style="width:98%;text-align:center;margin-top:5px;" border="1" id="${menu.tag}">
								    					<thead>
									    					<th>序号</th>
									    					<th>操作</th>
									    					<th>发文单位</th>
									    					<th>上传用户</th>
									    					<th>文件名</th>
									    					<th>发文日期</th>
									    					<th>上传日期</th>
									    					<th>文件大小</th>
									    					<th>文件类型</th>
								    					</thead>
								    					<tbody>
								    						
								    					</tbody>
								    				</table>
								    			</li>
								    		</c:if>
							    		</c:forEach>
							        </ul>
							    </div>
							</div>
						</div>
					</div>
				</div>
				<div class="model">
					<div>
						<legend>五、检查评分</legend>
						<div class="content-title" id="checkResult">
						
						</div>
					</div>
				</div>
				<div class="model">
					<div class="content-btn">
						<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />
						&nbsp;&nbsp;&nbsp;&nbsp;
						<input id="btnCancel" class="btn" type="button" value="返 回" onclick="toBack()" />
					</div>
				</div>
			</div>
		</div>
	</form>
	<script src="${ctxStatic}/js/check/checkCommon.js" type="text/javascript"></script>
</body>
</html>